package com.ysh.smartplatform.event;


/**
 * Created by jackiechan on 2021/12/23 20:45
 * 当设备上下线的时候更新状态
 * @author jackiechan
 */
public class DevicePowerEvent {
    private DevicePowerEventType type;
    private String uuid;



    public DevicePowerEventType getType() {
        return type;
    }

    public void setType(DevicePowerEventType type) {
        this.type = type;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public static DevicePowerEvent sendOpen(String uuid) {
        DevicePowerEvent devicePowerEvent = new DevicePowerEvent();
        devicePowerEvent.setType(DevicePowerEventType.OPEN);
        devicePowerEvent.setUuid(uuid);
        return devicePowerEvent;
    }

    public static DevicePowerEvent sendClose(String uuid) {
        DevicePowerEvent devicePowerEvent = new DevicePowerEvent();
        devicePowerEvent.setType(DevicePowerEventType.CLOSE);
        devicePowerEvent.setUuid(uuid);
        return devicePowerEvent;
    }


    public static DevicePowerEvent sendCommand(String uuid,DevicePowerEventType type) {
        DevicePowerEvent devicePowerEvent = new DevicePowerEvent();
        devicePowerEvent.setType(type);
        devicePowerEvent.setUuid(uuid);
        return devicePowerEvent;
    }
}
